package com.nbicc.anon.newscat.controller;

import com.nbicc.common.RequestPageObj;
import com.nbicc.common.ResponseObj;
import com.nbicc.newscat.service.INewsCatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;

@Api(value = "新闻分类(匿名)" , description = "控制新闻和目录关系")
@RestController
@RequestMapping(value = "/anon/news/cat")
public class AnonNewsCatController {

    @Resource(name = "NewsCatServiceImpl")
    private INewsCatService newsCatService;

    @ApiOperation(value = "按目录查询新闻" , notes = "参数格式 catId=xxx 是否递归 isRecursion=true")
    @PostMapping("/find")
    @ResponseBody
    public ResponseObj find(@RequestBody RequestPageObj<Map<String,Object>> requestPageObj) throws Exception{
        ResponseObj responseObj = newsCatService.find(requestPageObj);
        return responseObj;
    }

}
